<div class="row">
    <div class="col-md-12">
        <div class="box-body box">
            <table class="table table-bordered">
                <tbody>
                <tr>
                    <th>ID</th>
                    <th>模块名</th>
                    <th>描述</th>
                    <th>依赖</th>
                    <th>操作</th>
                </tr>
                {% for key,item in data %}
                    <tr>
                        <td>{{ key }}</td>
                        <td>{{ item['name'] }}</td>
                        <td>{{ item['description'] }}</td>
                        <td>
                            <p>
                                <span>需求：</span> {% if item['require'] is defined %} {% for v in item['require'] %} {% if data[v] is defined %}
                                    <span class="label label-success">{{ v }}</span> {% else %}
                                    <span class="label label-danger">{{ v }}</span> {% endif %} {% endfor %} {% endif %}
                            </p>
                            <p>
                                <span>冲突：</span> {% if item['conflict'] is defined %} {% for v in item['conflict'] %} {% if data[v] is defined %}
                                    <span class="label label-danger">{{ v }}</span> {% endif %} {% endfor %} {% endif %}
                            </p>
                        </td>
                        <td>
                            <div class="btn-group">
                                {% if item['project'] is defined AND item['project'] == 'core' %}
                                    <a class="btn btn-danger disabled" type="button">核心模块不可操作</a>
                                {% else %}
                                    {% if enabledModules[key] is defined %}
                                        <a data-target="#main" href="{{ url(['for':'adminModulesDisable','module':key]) }}" class="btn btn-warning" type="button">禁用</a>
                                    {% else %}
                                        <a data-target="#main" href="{{ url(['for':'adminModulesEnable','module':key]) }}" class="btn btn-primary" type="button">启用</a>
                                    {% endif %}
                                    <a data-target="#main" href="{{ url(['for':'adminModulesUninstall','module':key]) }}" class="btn btn-danger" type="button">删除</a>
                                {% endif %}
                            </div>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
